#include "ThreadPool.h"
#include "Task.h"
#include <iostream>

class PrintTask : public Task {
public:
  explicit PrintTask(int id) : id_(id) {}
  Any run() override {
    std::this_thread::sleep_for(std::chrono::seconds(5));
    std::cout << "Task " << id_ << " executed\n";
    return {};
  }

private:
  int id_;
};

class CountSum : public Task {
public:
  CountSum(int begin, int end): begin_(begin), end_(end){}
  Any run() {
    int sum{};
    for (int i = begin_ ; i != end_; i ++) {
      sum += i;
    }

    return sum;
  };
private:
  int begin_{};
  int end_{};
};

int main() {
  ThreadPool pool;
  pool.start(4);

  return 0;
}